package com.stlm2.controller;

import com.stlm2.dems.service.IndexConfigService;
import com.stlm2.util.codecontent.CodeContent;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * Created by zlq on 2017/12/18.
 */
@Controller
@RequestMapping("indexConfigC")
public class indexConfigController {
    @Resource
    private IndexConfigService indexConfigService;

    @ResponseBody
    @RequestMapping(value="/getConfig.json",produces="application/json;charset=UTF-8")
    public  String  getConfig(ModelMap model) {
        String data=null;
        try {
            data=indexConfigService.getConfig( model,true);
        }catch (Exception e){
            e.printStackTrace();
            return  CodeContent.getModelByCode(0,"查询失败",data);
        }
        return  data;
    }
}
